package com.xuan.bigdogdemo.chat;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import com.xuan.bigapple.lib.ioc.InjectView;
import com.xuan.bigapple.lib.ioc.app.BPActivity;
import com.xuan.bigdogdemo.R;

/**
 * 测试主界面
 * 
 * @author xuan
 */
public class ChatTest extends BPActivity {
	@InjectView(R.id.content)
	private LinearLayout content;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		addButton("ConversationActivity", ConversationActivity.class);
	}

	private void addButton(String text, final Class<?> clazz) {
		Button button = new Button(ChatTest.this);
		button.setText(text);
		button.setOnClickListener(new Button.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent intent = new Intent();
				intent.setClass(ChatTest.this, clazz);
				startActivity(intent);
			}
		});
		content.addView(button);
	}

}
